package main

import "fmt"

type Profile01 struct {
	name   string
	age    int
	gender string
	mother *Profile01
	father *Profile01
}

type Profile02 struct {
	name, gender   string
	age            int
	mother, father *Profile02
}

func (person Profile01) FmtProfile() {
	fmt.Printf("名字: %s\n", person.name)
	fmt.Printf("年龄: %d\n", person.age)
	fmt.Printf("性别: %s\n", person.gender)
}

func (person *Profile01) increaseAge() {
	person.age += 1
}

type company struct {
	companyName string
	companyAddr string
}

type staff struct {
	name     string
	age      int
	gender   string
	position string
	company
}

func main() {
	xm := Profile01{name: "小明"}
	fmt.Println(xm.age)

	myself := Profile01{name: "小明", age: 24, gender: "male"}
	myself.FmtProfile()

	myself01 := Profile01{name: "小明", age: 24, gender: "male"}
	fmt.Printf("当前年龄: %d\n", myself01.age)
	myself01.increaseAge()
	fmt.Printf("当前年龄: %d\n", myself01.age)

	myCom := company{
		companyName: "Tencent",
		companyAddr: "深圳市南山区",
	}
	staffInfo := staff{
		name:     "小明",
		age:      28,
		gender:   "男",
		position: "云计算开发工程师",
		company:  myCom,
	}
	fmt.Printf("%s 在 %s 工作\n", staffInfo.name, staffInfo.companyName)
	fmt.Printf("%s 在 %s 工作\n", staffInfo.name, staffInfo.company.companyName)

	xm01 := new(Profile01)
	fmt.Println(xm01)
	xm01.name = "iswbm"
	xm01.age = 18
	xm01.gender = "male"
	fmt.Println(xm01)
}
